﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PurchaseGames.aspx.cs" Inherits="gamexpert.PurchaseGames" Theme="Black" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2><asp:Literal ID="Literal1" runat="server"></asp:Literal></h2>
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
                
                <asp:DataList ID="DataList1" runat="server" 
                    onselectedindexchanged="DataList1_SelectedIndexChanged" DataKeyField="id" 
                    onitemcommand="DataList1_ItemCommand" >
                <ItemTemplate>
                
 <div class="item">
                        <div class="itemleft">
                            <asp:LinkButton ID="LinkButton4" runat="server" CommandName="select" >
                            <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/images/"+ Eval("image") %>' CssClass="productimg" />
                            </asp:LinkButton>
                        </div>
                        <div class="itemright">
                            <div >
                                <h3><asp:LinkButton ID="LinkButton1" runat="server" CommandName="select" ><%# Eval("title") %></asp:LinkButton></h3>
                            </div>
                            <div>
                                <p><%# Eval("shortdescription") %></p>
                                <ul class="list">
                                    <li>Price:<%# Eval("price","S${0:f2}") %></li>
                                    <li>Shipping cost:<%# Eval("shippingcost","S${0:f2}") %></li>
                                    <li>Types:<%# Eval("category") %></li>
                                    <li>Start selling on:<%# Eval("createdon") %></li>
                                    <li>Publisher: <%# Eval("publisher") %> </li>
                                    <li>Developer: <%# Eval("developer") %> </li>
                                    <li>Platform: <%# Eval("platform") %> </li>
                                </ul>
                                <asp:LinkButton CssClass="floatright" ID="LinkButton3" runat="server" CommandName='AddToCart' CommandArgument='<%# Eval("id") %>' >Add to cart</asp:LinkButton>
                            </div>
                        </div>
                        <div  class="clear" ></div>
                    </div>               
                    
                </ItemTemplate>
            </asp:DataList>
            <div class="pagingcontainer" >
                <asp:LinkButton ID="lbtnCart" runat="server" CssClass="viewcart" onclick="lbtnCart_Click">|  &nbsp;View Cart</asp:LinkButton>
                <asp:Panel runat="server" id="pnlPager" CssClass="pagination">  
                </asp:Panel>
            </div>  
        </asp:View>
        
        <asp:View ID="View2" runat="server">
            
            <asp:FormView ID="FormView1" runat="server" DataKeyNames="id" Width="100%" onitemcommand="FormView1_ItemCommand">
                <EditItemTemplate>
                    id:
                    <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>' />
                    <br />
                    title:
                    <asp:TextBox ID="titleTextBox" runat="server" Text='<%# Bind("title") %>' />
                    <br />
                    description:
                    <asp:TextBox ID="descriptionTextBox" runat="server" 
                        Text='<%# Bind("description") %>' />
                    <br />
                    price:
                    <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
                    <br />
                    shippingcost:
                    <asp:TextBox ID="shippingcostTextBox" runat="server" 
                        Text='<%# Bind("shippingcost") %>' />
                    <br />
                    image:
                    <asp:TextBox ID="imageTextBox" runat="server" Text='<%# Bind("image") %>' />
                    <br />
                    category:
                    <asp:TextBox ID="categoryTextBox" runat="server" Text='<%# Bind("category") %>' />
                    <br />
                    date:
                    <asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    title:
                    <asp:TextBox ID="titleTextBox" runat="server" Text='<%# Bind("title") %>' />
                    <br />
                    description:
                    <asp:TextBox ID="descriptionTextBox" runat="server" 
                        Text='<%# Bind("description") %>' />
                    <br />
                    price:
                    <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price","S${0:f2}") %>' />
                    <br />
                    shippingcost:
                    <asp:TextBox ID="shippingcostTextBox" runat="server" 
                        Text='<%# Bind("shippingcost","S${0:f2}") %>' />
                    <br />
                    image:
                    <asp:TextBox ID="imageTextBox" runat="server" Text='<%# Bind("image") %>' />
                    <br />
                    category:
                    <asp:TextBox ID="categoryTextBox" runat="server" 
                        Text='<%# Bind("category") %>' />
                    <br />
                    date:
                    <asp:TextBox ID="dateTextBox" runat="server" Text='<%# Bind("date") %>' />
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
                <ItemTemplate>
                    <div class="pdetail">
                        <div id="divdtop">
                            <div><asp:LinkButton ID="LinkButton5" CssClass="floatright" runat="server" CommandName="AddToCart" CommandArgument='<%# Eval("id") %>' >Add to cart</asp:LinkButton></div>
                            <div id="divimg">
                                <asp:Image ID="Image2" runat="server" ImageUrl='<%# "~/images/"+Eval("image") %>' />
                            </div>
                            <div id="divlist">
                                <h3><asp:Label ID="titleLabel" runat="server" Text='<%# Bind("title") %>' /></h3>
                                <ul>
                                    <li><strong>Price :</strong>S$<asp:Label ID="priceLabel" runat="server" Text='<%# Bind("price","{0:N}") %>' /></li>
                                    <li><strong>Shipping Cost :</strong>S$<asp:Label ID="shippingcostLabel" runat="server" Text='<%# Bind("shippingcost","{0:N}") %>' /></li>
                                    <li><strong>Category:</strong><asp:Label ID="categoryLabel" runat="server" Text='<%# Bind("category") %>' /></li>
                                    <li><strong>Publisher:</strong><asp:Label ID="publisherLabel" runat="server" Text='<%# Bind("publisher") %>' /></li>
                                    <li><strong>Developer:</strong><asp:Label ID="developerLabel" runat="server" Text='<%# Bind("developer") %>' /></li>
                                    <li><strong>Platform:</strong><asp:Label ID="platformLabel" runat="server" Text='<%# Bind("platform") %>' /></li>
                                    <li><strong>Start selling on:</strong><asp:Label ID="dateLabel" runat="server" Text='<%# Bind("createdon") %>' /></li>
                                </ul>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div id="divdbody">
                            <asp:Label ID="descriptionLabel" runat="server" Text='<%# Bind("description") %>' />
                        </div>
                        <div id="divfoot">
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Back" >View other products</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton6" CssClass="floatright" runat="server" CommandName="AddToCart" CommandArgument='<%# Eval("id") %>' >Add to cart</asp:LinkButton>
                            <div class="clear"></div>
                        </div>
                    </div>
                </ItemTemplate>
            </asp:FormView>
        </asp:View>
        <asp:View ID="View3" runat="server">
       
        <p class="purchase_p">
            Successfully added the item you selected to the cart.&nbsp;&nbsp; 
            <asp:LinkButton ID="lbtnContinueShop" runat="server" OnClick="lbtnContinueShop_Click" >Continue shopping.</asp:LinkButton>
            |
            <asp:LinkButton ID="lbtnViewCart" runat="server" OnClick="lbtnViewCart_Click" >View Cart</asp:LinkButton>
        </p>
        
        </asp:View>
        
    </asp:MultiView>
    </asp:Content>
